import {
	myRequest
} from '../http.js'
import qs from 'qs'
// 添加购物车
export function addcart(data) {
	return myRequest({
		url: '/detail/cart',
		method: 'post',
		data: qs.stringify(data)
	})
}
//加减商品
export function changecart(data){
	return myRequest({
		url: '/cart/change',
		method: 'post',
		data:qs.stringify(data)
	})
}
//添加报价车
export function addquote_cart(data) {
	return myRequest({
		url: '/detail/quote_cart',
		method: 'post',
		data: qs.stringify(data)
	})
}
//收藏商品
export function collection(data) {
	return myRequest({
		url: '/goodslist/collection',
		method: 'post',
		data: qs.stringify(data)
	})
}

// 购物车接口
//删除多个商品
export function deletecart(data) {
	return myRequest({
		url: '/cart/delete_cart',
		method: "post",
		data: qs.stringify(data)
	})
}
//获取用户地址列表
export function getAddresslist(user_id) {
	return myRequest({
		url: '/cart/address',
		method: "post",
		data: user_id
	})
}
//用户添加新地址
// consignee: betate
// address: 测试
// mobile: 17688585610
// email: 123@qq.com
// fax: 123
// status: 0
export function addAddress(data) {
	return myRequest({
		url: '/address/add',
		method: "post",
		data: qs.stringify(data)
	})
}
//获取选择部门列表
export function getmember(company_id) {
	return myRequest({
		url: `/cart/member?lang=cn&company_id=${company_id}`,
		method: "get",
	})
}
//提交购物车
//department_id: 1395
// remark: 123123
// consignee: betate
// address: 测试
// mobile: 17688585610
// email: 123@qq.com
// goods[0]: 30731
export function submitcart(data) {
	return myRequest({
		url: '/cart/add',
		method: "post",
		data: qs.stringify(data)
	})
}
//下单状态
export function orderstatus(id) {
	return myRequest({
		url: '/orderstatus/goods',
		method: 'post',
		data: id
	})
}
export function getchildbrand(id) {
	return myRequest({
		url: `/goodslist/brand?lang=cn&id=${id}&search=&brand_id=&priority=`,
		method: 'get'
	})
}
